package com.atzly.community.mapper;

import com.atzly.community.entity.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zlysimida
 * @date 2021/8/25 - 11:20
 */
@Mapper
public interface DiscussPostMapper {

    List<DiscussPost> selectDiscussPost(@Param("userId") Integer userId, @Param("offset") Integer offset, @Param("limit") Integer limit,@Param("orderMode") int orderMode);

    Integer selectDiscussByUserId(@Param("userId") Integer userId);


    Integer insertDiscussPost(DiscussPost discussPost);

    DiscussPost selectDiscussDetails(@Param("id") int id);

    int updateDiscussPostCounts(int id,int commentCount);

    // 修改status
    int updateDiscussPostStatus(int id,int status);
    // 修改Type
    int updateDiscussPostType(int id,int type);


    void updateDiscussPostScore(int postId, double score);

    int getHotPostNums(int score);
}
